/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2023-11-20
 * Time: 22:16
 */
public class main6 {
    static int a=10;

    static{
        System.out.println("Main 方法所在静态代码块 static1");
    }

    public static void main(String[] args) {
        System.out.println("main start"+a);
        A a = new A();
        System.out.println(A.width);
        System.out.println(a.width);
        A b=new A();
    }
    static{
        System.out.println("Main 方法所在静态代码块 static2");
    }
}

class A{
    public static int width = 100;

    static{
        System.out.println("静态初始化类A");
        width = 30;
    }

    public A(){
        System.out.println("创建A类的对象");
    }

}